//
//  WCheckgoodsTitleView.m
//  ProjectforHDX
//
//  Created by motom on 16/8/26.
//  Copyright © 2016年 H.DX. All rights reserved.
//

#import "WCheckgoodsTitleView.h"

@interface WCheckgoodsTitleView()

@property (nonatomic, strong) RZCustomLable *plateContain;

@property (nonatomic, strong) RZCustomLable *plateName;

@property (nonatomic, strong) RZCustomLable *plateNo;

@property (nonatomic, strong) RZCustomLable *plateSeria;

@property (nonatomic, strong)RZCustomLable *plateNum;

@end

@implementation WCheckgoodsTitleView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setupView];
    }
    return self;
}

-(void)setupView
{
    
    self.backgroundColor = [UtilCheck hexStringToColor:@"#f5f7fa" alpha:1.0];
    
    RZCustomLable *plateName = [[RZCustomLable alloc]init];
    plateName.textColor = [UtilCheck hexStringToColor:@"#858e99" alpha:1.0];
    plateName.text = [UtilCheck language:@"setting.plateName"];
    [self addSubview:plateName];
    plateName.font = CustomFont(14);
    [plateName sizeToFit];
    self.plateName = plateName;
    
    RZCustomLable *plateNo = [[RZCustomLable alloc]init];
    plateNo.textColor = [UtilCheck hexStringToColor:@"#858e99" alpha:1.0];
    plateNo.text = [UtilCheck language:@"setting.plateNO"];
    [self addSubview:plateNo];
    plateNo.font = CustomFont(14);
    [plateNo sizeToFit];
    self.plateNo = plateNo;
    
    RZCustomLable *plateSeria = [[RZCustomLable alloc]init];
    plateSeria.textColor = [UtilCheck hexStringToColor:@"#858e99" alpha:1.0];
    plateSeria.text = [UtilCheck language:@"setting.plateSerial"];
    [self addSubview:plateSeria];
    plateSeria.font = CustomFont(14);
    [plateSeria sizeToFit];
    self.plateSeria = plateSeria;
    
    RZCustomLable *plateContain = [[RZCustomLable alloc]init];
    plateContain.textColor = [UtilCheck hexStringToColor:@"#858e99" alpha:1.0];
    plateContain.text = [UtilCheck language:@"seeting.containNo"];
    [self addSubview:plateContain];
    plateContain.font = CustomFont(14);
    [plateContain sizeToFit];
    self.plateContain = plateContain;
    
    RZCustomLable *plateNum = [[RZCustomLable alloc]init];
    plateNum.textColor = [UtilCheck hexStringToColor:@"#858e99" alpha:1.0];
    plateNum.text = [UtilCheck language:@"order.quantity"];
    [self addSubview:plateNum];
    plateNum.font = CustomFont(14);
    [plateNum sizeToFit];
    self.plateNum = plateNum;
}

- (void)setIsCunOrQu:(BOOL)isCunOrQu{
    _isCunOrQu  = isCunOrQu;
    self.plateContain.text = [UtilCheck language:@"seeting.CaseNo"];
    
}

#define topMarin 10
-(void)layoutSubviews
{
        CGFloat width =  SCREEN_WIDTH / 5;
        self.plateNo.left = 1.0*width;
        self.plateSeria.left = 2 *width;
        self.plateContain.left = 3 *width;
        self.plateNum.left =4 *width;
    
        self.plateName.top = topMarin;
        self.plateName.left = 10;
        //    [self.plateName sizeToFit];
        
        
        self.plateNo.top = self.plateName.top;
        //    [self.plateNo sizeToFit];
        
        self.plateSeria.top = self.plateName.top;
        //    [self.plateSeria sizeToFit];
        
        self.plateContain.top  = self.plateName.top;
        //    [self.plateContain sizeToFit];
    
        self.plateNum.top = self.plateName.top;
    
        [self addSoldLine:1.0 soldcolor:[UtilCheck hexStringToColor:@"f0f0f0" alpha:1.0] pointA:CGPointMake(0,40) pointB:CGPointMake(SCREEN_WIDTH, 40)];
    

}

@end
